load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "exprctx",
    srcs = [
        "context.go",
        "optional.go",
        "param.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/expression/exprctx",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/errctx",
        "//pkg/parser/mysql",
        "//pkg/sessionctx/variable",
        "//pkg/types",
        "//pkg/util/context",
        "//pkg/util/intest",
        "//pkg/util/mathutil",
        "@com_github_pingcap_errors//:errors",
    ],
)

go_test(
    name = "exprctx_test",
    timeout = "short",
    srcs = [
        "context_override_test.go",
        "optional_test.go",
    ],
    embed = [":exprctx"],
    flaky = True,
    shard_count = 4,
    deps = [
        "//pkg/errctx",
        "//pkg/expression/exprstatic",
        "//pkg/types",
        "@com_github_stretchr_testify//require",
    ],
)
